package tests.testclasses
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	import mx.utils.ObjectUtil;
	
	public class UndoAbleTestClass extends EventDispatcher
	{
		public function UndoAbleTestClass(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		private var _testDateProperty:Date = new Date(null);
		public function get testDateProperty():Date
		{
			return _testDateProperty;
		}
		[Bindable(event="testDatePropertyChanged")]
		public function set testDateProperty(value:Date):void
		{
			if (ObjectUtil.dateCompare(value,_testDateProperty) != 0)
			{
				_testDateProperty = value;
				dispatchEvent(new Event("testDatePropertyChanged"));
			}
		}

		private var _testStringProperty:String = "";
		[Undoable]
		public function get testStringProperty():String
		{
			return _testStringProperty;
		}
		[Bindable(event="testStringPropertyChanged")]
		public function set testStringProperty(value:String):void
		{
			if (value != _testStringProperty)
			{
				_testStringProperty = value;
				dispatchEvent(new Event("testStringPropertyChanged"));
			}
		}

		private var _testNumberProperty:Number = 0;
		[Undoable]
		public function get testNumberProperty():Number
		{
			return _testNumberProperty;
		}
		[Bindable(event="testNumberPropertyChanged")]
		public function set testNumberProperty(value:Number):void
		{
			if (value != _testNumberProperty)
			{
				_testNumberProperty = value;
				dispatchEvent(new Event("testNumberPropertyChanged"));
			}
		}

	}
}